package com.jfxia.arkles;

import javafx.data.pull.Event;


/**
 * Details a node in an event tree, used to call events on an element 
 * in the input tree.
 */
public class EventNode {
	/**
	 * Tag name.
	 */
	public-init var name:String;
	/**
	 * Child nodes.
	 */
	public-init var content:EventNode[] on replace {
		for(i in content) { i.parent=this; }
	};
	
	/**
	 * Opening <tag> event handler.
	 */
	public-init var onStart:function(ev:Event) : Void;
	/**
	 * Loose text node tags.
	 */
	public-init var onText:function(ev:Event) : Void;
	/**
	 * Closing </tag> event handler.
	 */
	public-init var onEnd:function(ev:Event) : Void;

	/**
	 * Parent to this node (or null of root!)
	 */
	package var parent:EventNode;
}